inherited rstAccpoints: TrstAccpoints
  Left = 252
  Top = 174
  HelpContext = 1144
  ActiveControl = dbeMaName
  Caption = #1058#1086#1095#1082#1080' '#1080#1085#1089#1090#1088#1091#1084#1077#1085#1090#1072#1083#1100#1085#1086#1075#1086' '#1091#1095#1077#1090#1072
  OnActivate = FormActivate
  PixelsPerInch = 96
  TextHeight = 13
  inherited Splitter1: TSplitter
    Left = 570
    MinSize = 270
    OnCanResize = Splitter1CanResize
  end
  inherited ToolBar1: TToolBar
    inherited ToolButton9: TToolButton
      Visible = False
    end
  end
  inherited Panel1: TPanel
    Left = 575
    Width = 269
    inherited TfraAddress1: TfraAddress
      Top = 107
      Width = 269
      Height = 217
      TabOrder = 1
      inherited SearchBox: TGroupBox
        Width = 269
        Height = 217
        inherited SubPanel: TPanel
          Width = 265
          Height = 200
          inherited Label6: TLabel
            Left = 13
            Alignment = taRightJustify
          end
          inherited Label5: TLabel
            Left = 55
            Alignment = taRightJustify
          end
          inherited Label4: TLabel
            Left = 34
            Alignment = taRightJustify
          end
          inherited Label3: TLabel
            Left = 59
            Alignment = taRightJustify
          end
          inherited Label2: TLabel
            Left = 50
            Alignment = taRightJustify
          end
          inherited Label1: TLabel
            Left = 31
            Alignment = taRightJustify
          end
          inherited TownBox: TDBLookupComboboxEh
            Left = 90
            Width = 160
            DropDownBox.SpecRow.CellsText = ' ----'
            DropDownBox.SpecRow.Value = '-1'
            DropDownBox.SpecRow.Visible = True
          end
          inherited StreetBox: TDBLookupComboboxEh
            Left = 90
            Width = 160
          end
          inherited NLSEdit: TDBEditEh
            Left = 90
            Width = 160
          end
          inherited NameEdit: TDBEditEh
            Left = 90
            Width = 160
          end
          inherited HouseBox: TDBLookupComboboxEh
            Left = 90
            Width = 160
          end
          inherited FindBtn: TButton
            Left = 4
            Top = 171
            Caption = #1055#1086#1080#1089#1082
          end
          inherited ClearBtn: TButton
            Left = 84
            Top = 171
            OnClick = TfraAddress1ClearBtnClick
          end
          inherited AppartBox: TDBLookupComboboxEh
            Left = 90
            Width = 160
          end
          inherited AddBtn: TButton
            Left = 164
            Top = 171
            Width = 95
            OnClick = TfraAddress1AddBtnClick
          end
          inherited cb1: TDBCheckBoxEh
            Left = 90
            Top = 150
            Width = 97
            Caption = #1047#1072#1082#1088#1099#1090#1099#1077' '#1051#1057
          end
        end
      end
      inherited QStreets: TpFIBDataSet
        Transaction = trList
        UpdateTransaction = trList
      end
      inherited QHouses: TpFIBDataSet
        Transaction = trList
        UpdateTransaction = trList
      end
      inherited QTowns: TpFIBDataSet
        Transaction = trList
        UpdateTransaction = trList
      end
      inherited QApparts: TpFIBDataSet
        SelectSQL.Strings = (
          
            'select cast(0 as integer) as id, cast('#39' ---- '#39' as varchar(15)) a' +
            's num, '
          '       cast(-1 as integer) as apparts, '
          '       cast(null as varchar(3)) as letter, '
          '       0 as acnt'
          '  from rdb$database'
          'union'
          'select max(v.id), v.num, v.apparts, v.letter, count(1) as acnt'
          '  from vw_abonents v'
          '  where v.building_id = :pbuilding_id'
          '    and v.client_id >= 0'
          '--    and v.is_active = 1'
          '  group by 2,3,4'
          '  order by 3,4')
        Transaction = trList
        UpdateTransaction = trList
      end
    end
    inherited GroupBox1: TGroupBox
      Width = 269
      Height = 107
      TabOrder = 0
      object Label1: TLabel
        Left = 32
        Top = 18
        Width = 50
        Height = 13
        Alignment = taRightJustify
        Caption = #1053#1072#1079#1074#1072#1085#1080#1077
      end
      object Label2: TLabel
        Left = 63
        Top = 42
        Width = 19
        Height = 13
        Alignment = taRightJustify
        Caption = #1058#1080#1087
      end
      object Label3: TLabel
        Left = 46
        Top = 66
        Width = 36
        Height = 13
        Alignment = taRightJustify
        Caption = #1059#1089#1083#1091#1075#1072
      end
      object dbeMaName: TDBEditEh
        Left = 90
        Top = 14
        Width = 160
        Height = 19
        AlwaysShowBorder = True
        EditButtons = <>
        Flat = True
        TabOrder = 0
        Visible = True
      end
      object cbMaType: TDBLookupComboboxEh
        Left = 90
        Top = 38
        Width = 160
        Height = 19
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        DropDownBox.SpecRow.CellsText = '---'
        DropDownBox.SpecRow.Visible = True
        EditButtons = <>
        Flat = True
        KeyField = 'ID'
        ListField = 'ACCTYPE'
        ListSource = dscTypes
        TabOrder = 1
        Visible = True
      end
      object cbServices: TDBLookupComboboxEh
        Left = 90
        Top = 62
        Width = 160
        Height = 19
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        DropDownBox.SpecRow.CellsText = '---'
        DropDownBox.SpecRow.Value = 0
        DropDownBox.SpecRow.Visible = True
        EditButtons = <>
        Flat = True
        KeyField = 'ID'
        ListField = 'NAME'
        ListSource = dsc_Services
        TabOrder = 2
        Visible = True
      end
      object cbClosedTU: TDBCheckBoxEh
        Left = 90
        Top = 84
        Width = 109
        Height = 17
        AlwaysShowBorder = True
        Caption = #1054#1090#1082#1083#1102#1095#1077#1085#1085#1099#1077' '#1058#1059
        Flat = True
        TabOrder = 3
        ValueChecked = '0'
        ValueUnchecked = '1'
      end
    end
    inherited TfraSubstanceInfo1: TfraSubstanceInfo
      Top = 324
      Width = 269
      Height = 245
      inherited TopPanel: TPanel
        Width = 269
        Height = 0
      end
      inherited BottomPanel: TPanel
        Top = 245
        Width = 269
        Height = 0
      end
      inherited PageControl: TPageControl
        Top = 0
        Width = 269
        Height = 245
        inherited TSInfo: TTabSheet
          inherited InfoGrid: TDBGridEh
            Width = 261
            Height = 214
            UseMultiTitle = True
            VTitleMargin = 5
          end
        end
      end
      inherited QSubstanceInfo: TpFIBDataSet
        SelectSQL.Strings = (
          'SELECT'
          '    RFIELD_NAME as name,'
          '    RFIELD_VALUE as val'
          'FROM'
          'PROC_ACCPOINT_GET_PROP_LIST(:ID)')
        Transaction = trRefer
        UpdateTransaction = trRefer
        DataSource = dscRefer
      end
    end
  end
  inherited Panel2: TPanel
    Width = 570
    inherited Splitter2: TSplitter
      Top = 405
      Width = 570
    end
    inherited GroupBox2: TGroupBox
      Top = 410
      Width = 570
      Height = 159
      Caption = ' '#1059#1089#1090#1072#1085#1086#1074#1083#1077#1085#1085#1099#1077' '#1087#1088#1080#1073#1086#1088#1099' '#1091#1095#1077#1090#1072' '
      inherited DetailGrid: TDBGridEh
        Width = 566
        Height = 142
        DataSource = dscDetail
        Options = [dgTitles, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit]
        UseMultiTitle = True
        VTitleMargin = 5
        Columns = <
          item
            EditButtons = <>
            FieldName = 'ID'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'METER_NUM'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'MTYPE'
            Footers = <>
            Width = 117
          end
          item
            EditButtons = <>
            FieldName = 'IND'
            Footers = <>
            Width = 96
          end
          item
            EditButtons = <>
            FieldName = 'INDDATE'
            Footers = <>
            Width = 97
          end>
      end
    end
    inherited Panel3: TPanel
      Width = 570
      Height = 405
      inherited dbgRefer: TDBGridEh
        Width = 570
        Height = 405
        Options = [dgTitles, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit]
        OnGetCellParams = dbgReferGetCellParams
        OnKeyDown = dbgReferKeyDown
        Columns = <
          item
            EditButtons = <>
            FieldName = 'RID'
            Footers = <>
            Width = 52
          end
          item
            EditButtons = <>
            FieldName = 'RMANAME'
            Footers = <>
            Width = 113
          end
          item
            EditButtons = <>
            FieldName = 'RACCTYPE'
            Footers = <>
            Width = 84
          end
          item
            Checkboxes = True
            EditButtons = <>
            FieldName = 'RPARENT_EXISTS'
            Footers = <>
            Visible = False
          end
          item
            Checkboxes = True
            EditButtons = <>
            FieldName = 'RHEATCOUNTER'
            Footers = <>
            Visible = False
          end
          item
            EditButtons = <>
            FieldName = 'RGROUP_ACC'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'RTOWN'
            Footers = <>
            Width = 94
          end
          item
            EditButtons = <>
            FieldName = 'RSTREET_NAME'
            Footers = <>
            Width = 121
          end
          item
            EditButtons = <>
            FieldName = 'RHOUSE'
            Footers = <>
            Width = 74
          end
          item
            EditButtons = <>
            FieldName = 'RSERVICE_NAME'
            Footers = <>
          end>
      end
    end
  end
  inherited shblActionList: TActionList
    Left = 124
    inherited aDelete: TAction
      Visible = False
    end
  end
  inherited dsRefer: TpFIBDataSet
    InsertSQL.Strings = (
      'insert into m_accpoint (id, name, account_type)'
      'values (:rid, :rname, :racctype)')
    RefreshSQL.Strings = (
      'select'
      'rid,'
      'rmaname,'
      'rparent_exists,'
      'racctype,'
      'rheatcounter,'
      'rgroup_acc,'
      'rtown,'
      'rstreet_name,'
      'rhouse,'
      'rservice_name,'
      'rid as id'
      'from proc_v_accpoints ('
      ':pmaname,'
      ':ptype,'
      ':ptown_id,'
      ':pstreet_id,'
      ':pbuilding_id,'
      ':papparts,'
      ':pletter,'
      ':pnls,'
      ':pname,'
      ':pactive,'
      ':addparam||'#39'|accpoint_id='#39'||:rid)')
    SelectSQL.Strings = (
      'select'
      'rid,'
      'rmaname,'
      'rparent_exists,'
      'racctype,'
      'rheatcounter,'
      'rgroup_acc,'
      'rtown,'
      'rstreet_name,'
      'rhouse,'
      'rservice_name,'
      'rid as id,'
      
        'iif(exists (select 1 from proc_accpoint_get_childs (rid, current' +
        '_date, current_date, 1) pc), 1, 0) as child_active'
      ''
      'from proc_v_accpoints ('
      ':pmaname,'
      ':ptype,'
      ':ptown_id,'
      ':pstreet_id,'
      ':pbuilding_id,'
      ':papparts,'
      ':pletter,'
      ':pnls,'
      ':pname,'
      ':pactive,'
      ':addparam)')
    AutoUpdateOptions.UpdateTableName = 'PROC_V_ACCPOINTS'
    AutoUpdateOptions.KeyFields = 'RID'
    Database = MAINDM.pMainDatabase
    object dsReferRID: TFIBIntegerField
      DisplayLabel = #1048#1044
      FieldName = 'RID'
    end
    object dsReferRMANAME: TFIBStringField
      DisplayLabel = #1053#1072#1079#1074#1072#1085#1080#1077
      FieldName = 'RMANAME'
      EmptyStrToNull = True
    end
    object dsReferRACCTYPE: TFIBStringField
      DisplayLabel = #1058#1080#1087
      FieldName = 'RACCTYPE'
      Size = 60
      EmptyStrToNull = True
    end
    object dsReferRPARENT_EXISTS: TFIBIntegerField
      DisplayLabel = #1059#1079#1077#1083
      FieldName = 'RPARENT_EXISTS'
    end
    object dsReferRHEATCOUNTER: TFIBSmallIntField
      DisplayLabel = #1058#1077#1087#1083#1086#1074#1099#1095'.'
      FieldName = 'RHEATCOUNTER'
    end
    object dsReferRGROUP_ACC: TFIBSmallIntField
      DisplayLabel = #1054#1073#1097#1072#1103
      FieldName = 'RGROUP_ACC'
    end
    object dsReferRTOWN: TFIBStringField
      DisplayLabel = #1053#1072#1089'.'#1087#1091#1085#1082#1090
      FieldName = 'RTOWN'
      Size = 60
      EmptyStrToNull = True
    end
    object dsReferRSTREET_NAME: TFIBStringField
      DisplayLabel = #1059#1083#1080#1094#1072
      FieldName = 'RSTREET_NAME'
      Size = 255
      EmptyStrToNull = True
    end
    object dsReferRHOUSE: TFIBStringField
      DisplayLabel = #1044#1086#1084
      FieldName = 'RHOUSE'
      Size = 120
      EmptyStrToNull = True
    end
    object dsReferRSERVICE_NAME: TFIBStringField
      DisplayLabel = #1059#1089#1083#1091#1075#1072
      DisplayWidth = 20
      FieldName = 'RSERVICE_NAME'
      Size = 120
      EmptyStrToNull = True
    end
    object dsReferID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsReferCHILD_ACTIVE: TFIBIntegerField
      FieldName = 'CHILD_ACTIVE'
    end
  end
  inherited PropStorage: TPropStorageEh
    Section = 'rstAccpoints'
    StoredProps.Strings = (
      '<P>.Height'
      '<P>.Left'
      '<P>.PixelsPerInch'
      '<P>.Top'
      '<P>.Width'
      '<P>.WindowState'
      'Panel2.GroupBox2.<P>.Height'
      'Panel2.GroupBox2.DetailGrid.<P>.Columns.ColumnsIndex'
      'Panel2.GroupBox2.DetailGrid.<P>.Columns.<ForAllItems>.Width'
      'Panel2.Panel3.dbgRefer.<P>.Columns.ColumnsIndex'
      'Panel2.Panel3.dbgRefer.<P>.Columns.<ForAllItems>.Width')
  end
  object dsDetail: TpFIBDataSet [15]
    SelectSQL.Strings = (
      'select m.id, m.meter_num, mt.name as mtype, m.name,'
      '       rph as ind, rdate as inddate'
      '  from meters m'
      '  join meter_types mt on mt.id = m.meter_type'
      '  left join proc_meter_get_ind(m.id, current_date) p on 1=1'
      'where m.accpoint_id = :id')
    Transaction = trRefer
    Database = MAINDM.pMainDatabase
    DataSource = dscRefer
    Left = 76
    Top = 508
    WaitEndMasterScroll = True
    dcForceOpen = True
    object dsDetailID: TFIBIntegerField
      DisplayLabel = #1048#1044
      FieldName = 'ID'
    end
    object dsDetailMETER_NUM: TFIBStringField
      DisplayLabel = #8470#1087#1088#1080#1073#1086#1088#1072
      FieldName = 'METER_NUM'
      EmptyStrToNull = True
    end
    object dsDetailMTYPE: TFIBStringField
      DisplayLabel = #1058#1080#1087' '#1087#1088#1080#1073#1086#1088#1072
      FieldName = 'MTYPE'
      Size = 16
      EmptyStrToNull = True
    end
    object dsDetailIND: TFIBBCDField
      DisplayLabel = #1058#1077#1082#1091#1097'.'#1087#1086#1082#1072#1079#1072#1085#1080#1103
      FieldName = 'IND'
      Size = 3
      RoundByScale = True
    end
    object dsDetailINDDATE: TFIBDateField
      DisplayLabel = #1044#1072#1090#1072' '#1087#1086#1082#1072#1079#1072#1085#1080#1081
      FieldName = 'INDDATE'
    end
  end
  object dscDetail: TDataSource [16]
    DataSet = dsDetail
    Left = 108
    Top = 508
  end
  object dsTypes: TpFIBDataSet [17]
    SelectSQL.Strings = (
      'select '
      '  id,'
      '  acctype'
      'from m_accpoint_type')
    Transaction = trList
    Database = MAINDM.pMainDatabase
    Left = 590
    Top = 46
    object dsTypesID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsTypesACCTYPE: TFIBStringField
      FieldName = 'ACCTYPE'
      Size = 60
      EmptyStrToNull = True
    end
  end
  object dscTypes: TDataSource [18]
    DataSet = dsTypes
    Left = 622
    Top = 46
  end
  object ds_Services: TpFIBDataSet [19]
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    NAME'
      'FROM'
      '    SERVICES s0 '
      'where GROUP_ID = 0'
      'order by 2')
    Transaction = trList
    Database = MAINDM.pMainDatabase
    Left = 590
    Top = 82
    object ds_ServicesID: TFIBIntegerField
      FieldName = 'ID'
    end
    object ds_ServicesNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 120
      EmptyStrToNull = True
    end
  end
  object dsc_Services: TDataSource [20]
    DataSet = ds_Services
    Left = 622
    Top = 82
  end
end
